Skip to content

Add config apply request queue #949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 15, 2025
Merged

Conversation

dhurley
Copy link
Collaborator

@dhurley dhurley commented Dec 13, 2024

Proposed changes

If more than one config apply requests are sent to the agent at once the agent will only apply the changes in the latest config apply request.

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • I have run make install-tools and have attached any dependency changes to this pull request
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • If applicable, I have updated any relevant documentation (README.md)
  • If applicable, I have tested my cross-platform changes on Ubuntu 22, Redhat 8, SUSE 15 and FreeBSD 13

@dhurley dhurley added the v3.x Issues and Pull Requests related to the major version v3 label Dec 13, 2024
@dhurley dhurley self-assigned this Dec 13, 2024
@github-actions github-actions bot added the chore Pull requests for routine tasks label Dec 13, 2024
@dhurley dhurley marked this pull request as ready for review December 13, 2024 14:22
@dhurley dhurley requested a review from a team as a code owner December 13, 2024 14:22
@dhurley dhurley merged commit 9b1bc5b into v3 Jan 15, 2025
20 checks passed
@dhurley dhurley deleted the chore/support-mulitple-config-updates branch January 15, 2025 15:06
sean-breen pushed a commit that referenced this pull request Jan 15, 2025
sean-breen added a commit that referenced this pull request Jan 28, 2025
* support reading token from file via config

* remove empty file

* simplify token validation and add unit tests

* add unit tests for transport credentials funtions

* address PR feedback

* proto updates

* fix function name

* fix lint error: lll

* add missing PR feedback

* remove error log message

* fix unit test

* Fix apk test package naming (#961)

* modify alpine package name:
nginx-agent-3.0.0_1234 -> nginx-agent-3.0.0.1234

* protoc-gen update

* Update agent config defaults and format (#959)

* update config defaults and format

* Add config apply request queue (#949)

* add unit tests for transport credentials funtions

* fix test name

* fix error message

* fix lint error: lll

* modify error messages

* remove error logging and modify messages

* fall back to token field if error occurs when reading file

* fix bad merge

* restarting gRPC conn

* remove code from testing

* fix lint errors: whitespace, revive

* use tokenpath as config option, fixes problem with cli param parsing

* correct yaml key in AuthConfig

* proto updates

---------

Co-authored-by: aphralG <[email protected]>
Co-authored-by: Donal Hurley <[email protected]>
sean-breen added a commit that referenced this pull request Mar 3, 2025
* support reading token from file via config

* remove empty file

* simplify token validation and add unit tests

* add unit tests for transport credentials funtions

* address PR feedback

* proto updates

* fix function name

* fix lint error: lll

* add missing PR feedback

* remove error log message

* fix unit test

* Fix apk test package naming (#961)

* modify alpine package name:
nginx-agent-3.0.0_1234 -> nginx-agent-3.0.0.1234

* protoc-gen update

* Update agent config defaults and format (#959)

* update config defaults and format

* Add config apply request queue (#949)

* add unit tests for transport credentials funtions

* fix test name

* fix error message

* fix lint error: lll

* modify error messages

* remove error logging and modify messages

* fall back to token field if error occurs when reading file

* fix bad merge

* restarting gRPC conn

* remove code from testing

* fix lint errors: whitespace, revive

* add new topic for handling Token file updates

* add CredentialWatcherService

* adding initial watcher for credential files

* trigger connection reset after credential update

* added ConnectionResetTopic and event processing

* Automatically add token-path to Credential watcher

* add function to check credential paths defined in agent config

* fix lint

* use tokenpath as config option, fixes problem with cli param parsing

* add CredentialWatcherService + tests

* fix lint errors

* updates to generated files

* Send create connection after disconnect from management plane (#967)

* correct yaml key in AuthConfig

* fix: flaky test (#968)

`TestConvertToStructs` was occasionally failing because it was expecting `range` over a `map` to be a consistent order, but per [spec]:

> The iteration order over maps is not specified and is not guaranteed to be the same from one iteration to the next.

Uses `ElementsMatch` so the test passes even when the order of elements is different.

[spec]: https://go.dev/ref/spec#RangeClause

* update tests

* update tests

* wait for create connection

* PR feedback

* fix race condition

* clean up

* clean up

* update grpc connection in command and file plugins

* move log message and fix file_plugin_test.go

* fix lint

* handle command and file service client updates after grpc reset

* update FakeCommandService

* add unit tests

* fix bad test

* formatting

* remove test

* increase timeout before checking connection after restart

* set isConnected to false when handling subscribe errors

* increase code coverage

* lint fix

* fieldalignment

* remove unused fake

* PR feedback

* update fake command service

* more PR feedback

* PR feedback: disable watcher during config apply

* don't pause credential watcher during config apply

* debug log messages

* Add mutex around updating client in the CommandService

* undo change to metric name

* update test

* lock watcher when replacing grpc connection

* add lock around subscibe client access

* fix lint error

* unlock watcher mutex in error case

* return with no blank line

* lint error ?

* handle rename cases

* remove unneccessary cases from switch

* rewrite switch as if

* handling kubernetes secret update case

* fix test

* save connection status when resetting file manager service

---------

Co-authored-by: aphralG <[email protected]>
Co-authored-by: Donal Hurley <[email protected]>
Co-authored-by: Ryan Davis <[email protected]>
Co-authored-by: Aphral Griffin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Pull requests for routine tasks v3.x Issues and Pull Requests related to the major version v3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants